<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('任务列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
    <div class="row">
        <div class="col-sm-12 search-collapse">
            <form id="post-form">
                <div class="select-list">
                    <ul>
                        <li>
                            任务标题：<input type="text" name="missionTitle"/>
                        </li>
                        <li>
                            执行人员：<input type="text" name="infoName"/>
                        </li>
                        <li>
                            <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                            <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                        </li>
                    </ul>
                </div>
            </form>
        </div>

        <div class="col-sm-12 select-table table-striped">
            <table id="bootstrap-table"></table>
        </div>
    </div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
    var prefix = ctx + "task/receive";

    $(function() {
        var options = {
            url: prefix + "/list",
            sortName: "missionId",
            modalName: "任务接收查看",
            columns: [
                {
                    field: 'missionTitle',
                    title: '任务标题',
                },
                {
                    field: 'infoName',
                    title: '执行人',
                },
                {
                    field: 'endTime',
                    title: '结束时间',
                },
                {
                    field: 'status',
                    title: '状态',
                    align: 'center',
                    formatter: function(value, row, index) {
                        return value == "1" ? "已完成" : (value == "0" ? "未完成": "放弃" ) ;
                    }
                },
                {
                    field: 'urgencyLevel',
                    title: '紧急程度',
                    formatter: function(value, row, index) {
                        return value == "1" ? "紧急" : (value == "0" ? "一般": "非常紧急" ) ;
                    }
                }
                ]
        };
        $.table.init(options);
    });
</script>
</body>
</html>